
/**
 *
 * @author poemdexter
 *
 */

//modifications by ehushagen

import java.util.List;
import java.util.logging.Logger;

public class poemFishing extends Plugin {

    protected static final Logger log = Logger.getLogger("Minecraft");
    static final poemFishingListener listener = new poemFishingListener();

    public void enable() {
        log.info("poemFishingEHMod plugin Enabled.");
        etc.getInstance().addCommand("/bucket", " <itemID> <amount> - Look in bucket or take items out of bucket.");
        FishingMod.getInstance().load();
        FishingMod.getInstance().loadData();
        tellMods("poemFishingEHMod plugin enabled");
    }

    public void disable() {
        log.info("poemFishingEHMod plugin disabled");
        etc.getInstance().removeCommand("/bucket");
        tellMods("poemFishingEHMod plugin disabled");
    }

    public void initialize() {
        etc.getLoader().addListener(PluginLoader.Hook.COMMAND, listener, this, PluginListener.Priority.MEDIUM);
        etc.getLoader().addListener(PluginLoader.Hook.BLOCK_CREATED, listener, this, PluginListener.Priority.MEDIUM);
    }

    public void tellMods(String message) {
        List<Player> pList = etc.getInstance().getServer().getPlayerList();
        for (Player p : pList) {
            if (p.isInGroup("mods")) {
                p.sendMessage(Colors.Rose + message);
            }
            if (p.isInGroup("minimods")) {
                p.sendMessage(Colors.Rose + message);
            }
        }
    }

    
}
